home *** CD-ROM | disk | FTP | other *** search
/ PC-SIG: World of Games / PC-SIG World of Games (CDRM1080710) (1993).iso / ENT / DISK1314.ZIP / KSCOPE.BAS < prev    next >
BASIC Source File  |  1986-07-24  |  3KB  |  69 lines

  1.  
  2.  
  3. 100 'KALEIDOSCOPE - JOHN SCHNELL - AUGUST 82
  4. 110 CLS
  5. 120 '
  6. 130 DEFINT A-Z
  7. 140 '
  8. 150 'initialize random number generator using MINUTES and SECONDS of TIME$ variable
  9. 160 N=VAL(MID$(TIME$,4,2)+MID$(TIME$,7,2)) MOD 32767
  10. 170 RANDOMIZE(N)
  11. 180 '
  12. 190 'initialize CHARACTER and ATTRIBUTE arrays
  13. 200 OPTION BASE 0
  14. 210 DIM C$(4),A(1)
  15. 220 C$(0)=CHR$(32)      'character for black (space)
  16. 230 C$(1)=CHR$(176)     'character for gray-value one
  17. 240 C$(2)=CHR$(177)     'character for gray-value two
  18. 250 C$(3)=CHR$(178)     'character for gray-value three
  19. 260 C$(4)=CHR$(219)     'character for white
  20. 270 A(0)=7              'attribute for normal intensity
  21. 280 A(1)=10             'attribute for high intensity
  22. 290 '
  23. 300 'setup screen
  24. 310 KEY OFF             'turn function key display off
  25. 320 COLOR 7,0
  26. 330 LOCATE 25,14,0      'set cursor on line 25 and turn cursor off
  27. 340 PRINT"***   push <space-bar> to clear screen or <X> to exit   ***";
  28. 350 '
  29. 360 'initialize V and H to near center of screen
  30. 370 V=13-RND(RND(13*RND(1))) : H=40-RND(RND(40*RND(1)))
  31. 380 '
  32. 390 'calculate next V,H position
  33. 400 VV=V : HH=H                                 'save old value for V and H
  34. 410 V=V+4*RND(1)-2                              'move up, down, or stay
  35. 420 IF V<1 OR V>12 THEN V=VV : GOTO 410         'check vertical plot range
  36. 430 H=H+4*RND(1)-2                              'move left, right, or stay
  37. 440 IF H<1 OR H>39 THEN H=HH : GOTO 430         'check horizontal plot range
  38. 450 IF 30*RND(1)<28 THEN 490                    'random shot to relocate plot
  39. 460 V=13*RND(1)+1 : H=40*RND(1)+1               'calculate new random position
  40. 470 '
  41. 480 'determine next character to plot
  42. 490 ATTRIB=A(RND(1))                            'get random attribute
  43. 500 CHAR=4*RND(1)                               'get random character
  44. 510 '
  45. 520 'play note and plot kaleidoscope
  46. 530 SOUND V*H*5+37,1                            'play sound using V and H
  47. 540 COLOR ATTRIB,0                              'set attribute mode
  48. 550 LOCATE V,H
  49. 560 PRINT C$(CHAR);
  50. 570 LOCATE 24-V,H
  51. 580 PRINT C$(CHAR);
  52. 590 LOCATE V,80-H
  53. 600 PRINT C$(CHAR);
  54. 610 LOCATE 24-V,80-H
  55. 620 PRINT C$(CHAR);
  56. 630 '
  57. 640 'check if blank screen or exit is requested
  58. 650 RESP$=INKEY$
  59. 660 IF RESP$=" " THEN COLOR 7,0 : CLS : GOTO 320
  60. 670 IF RESP$="X" OR RESP$="x" THEN 710
  61. 680 GOTO 400
  62. 690 '
  63. 700 'restore everything before quitting
  64. 710 COLOR 7,0
  65. 720 CLS
  66. 730 KEY ON
  67. 740 RUN "MENU.PGM"
  68. $="x" THEN 710
  69. 680 GOTO 400